package com.xbongbong.saas.service;

import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.score.pojo.dto.DataScoreUpdateBatchDTO;
import com.xbongbong.pro.score.pojo.dto.DataScoreUpdateSingleDTO;
import com.xbongbong.pro.score.pojo.dto.ScoreRabbitMqDTO;
import com.xbongbong.pro.score.pojo.vo.DataScoreUpdateBatchVO;
import com.xbongbong.pro.score.pojo.vo.DataScoreUpdateSingleVO;
import com.xbongbong.saas.enums.XbbRefTypeEnum;

import java.util.List;

/**
 * @author chunyang.qin
 * @Title: 评分展示方式
 * @date 2020/12/2
 */
public interface ScoreCalculateService {

    /**
     * 异步更新数据评分
     * @param xbbRefTypeEnum
     * @param corpid
     * @param dataId
     */
    void asyncUpdateSingleDataScore(XbbRefTypeEnum xbbRefTypeEnum , String corpid , Long dataId, PaasFormDataEntityExt paasFormDataEntityExt);

    /**
     * 移除批量处理数据
     * @param xbbRefTypeEnum
     * @param corpid
     * @param idIn
     */
    void asyncUpdateBatchDataScore(XbbRefTypeEnum xbbRefTypeEnum , String corpid , List<Long> idIn);

    /**
     * 更新单条数据的评分
     * @param corpid 公司id
     * @param xbRefTypeEnum 参与评分的业务类型
     * @param paasFormDataEntity 参与评分计算的数据实体
     * @return
     * @throws XbbException
     */
    BaseVO singleDataScoreUpdate(String corpid , XbbRefTypeEnum xbRefTypeEnum, PaasFormDataEntityExt paasFormDataEntity);

    /**
     * 更新批量数据的评分
     * @param corpid
     * @param xbRefTypeEnum
     * @param paasFormDataEntityList
     * @return
     */
    BaseVO batchDataScoreUpdate(String corpid , XbbRefTypeEnum xbRefTypeEnum, List<PaasFormDataEntityExt> paasFormDataEntityList);

    /**
     * 评分消费者，脚本逻辑处理
     * scoreRabbitMqDTO
     */
    void batchDataScoreUpdateForScript(ScoreRabbitMqDTO scoreRabbitMqDTO) throws XbbException;

    /**
     * 批量更新分数
     * @param dataScoreUpdateBatchDTO
     * @throws XbbException
     * @return
     */
    DataScoreUpdateBatchVO updateBatch(DataScoreUpdateBatchDTO dataScoreUpdateBatchDTO) throws XbbException;

    DataScoreUpdateSingleVO updateSingle(DataScoreUpdateSingleDTO dataScoreUpdateSingleDTO) throws XbbException;

}
